import sys
from pathlib import Path

base_path = str(Path(__file__).resolve().parent.parent)
sys.path.append(base_path)
from langchain_community.document_loaders import TextLoader

text_loader = TextLoader(
    file_path=f"{base_path}/data/architect.json",
    encoding="utf-8",
    autodetect_encoding=False,
)

# 加载器load函数返回的是<class 'langchain_core.documents.base.Document'>
docs = text_loader.load()
print(type(docs[0]), docs[0])
